import request from '@/utils/request'

// 查询订单列表
export function listSellerOrder(query) {
  return request({
    url: '/order/order/sellerOrder/selectOrderListNew',
    // url: '/purchase/sellerOrder/selectOrderListUser',
    method: 'get',
    params: query
  })
}


//查看订单详情
export function getOrderDetail(data) {
  return request({
    url: '/order/order/sellerOrder/getProductInfoByOrderId',
    method: 'get',
    params: data
  })
}

// 修改订单状态
export function alterInnerStatus(query) {
  return request({
    url: '/order/order/sellerOrder/alterInnerStatus',
    method: 'post',
    data: query
  })
}

// // 转待发货审核
// export function submitForReview(query) {
//   return request({
//     url: '/freight/purchase/fpx/submitForReview',
//     method: 'post',
//     data: query
//   })
// }

// 提交待发货审核
export function submitForReview(query) {
  return request({
    url: '/freight/purchase/fpx/submitForReview',
    method: 'post',
    data: query
  })
}

// 新增采集链接
export function addCollectLink(query) {
  return request({
    url: '/gather/collectAbsentSku/add',
    method: 'post',
    data: query
  })
}

// 仓储发货
export function warehousGoodsOutFPX(data) {
  return request({
    url: "/order/purchase/fpx/warehousGoodsOutFPX",
    method: 'post',
    data: data
  })
}

// 获取当前账号店铺信息
export function getStoreInfo(data) {
  return request({
    url: "/shop/purchase/sellerOrder/getStoreInfo",
    method: 'get',
    data: data
  })
}


// 申请截单
export function cutOrderApplication(data) {
  return request({
    url: "/order/order/sellerOrder/cutOrderApplication",
    method: 'post',
    data: data
  })
}

//查看订单日志
export function viewOrderLog(data) {
  return request({
    url: "/order/order/sellerOrderLog/getOrderLog",
    method: 'get',
    params: data
  })
}

//获取标记发货数量
export function getStatementOrder(data) {
  return request({
    url: "/gather/ae/purchaseOrder/redReminderForShipmentOrder",
    method: 'get',
    params: data
  })
}

//获取公司测评订单数量
export function getRedReminderCompany(data) {
  return request({
    url: "/gather/gather/sellerStoreProductEvaluation/redReminderCompany",
    method: 'get',
    params: data
  })
}

//获取标记发货数量
export function getGroupValue(data) {
  return request({
    url: "/gather/ae/purchaseOrder/redReminderForHandoverOrder",
    method: 'get',
    params: data
  })
}

// 获取AE信息
export function getAeInfo(data) {
  return request({
    url: '/AeOrder/getAeInfo',
    method: 'get',
    params: data
  })
}

// ERP从速卖通获取订单
export function getAEOrderList(query) {
  return request({
    url: '/gather/AeOrder/pullOrdersFromAliExpress',
    method: 'get',
    params: query
  })
}

// 订单作废
export function cancelOrder(query) {
  return request({
    url: '/order/order/sellerOrder/cancelOrder',
    method: 'post',
    data: query
  })
}

// 查看问题原因
export function specialCause(query) {
  return request({
    url: '/gather/seller/erpSellerOrderExtend/specialCause',
    method: 'get',
    params: query
  })
}

// 声明发货
export function sellerShipmentForTop(query) {
  return request({
    url: '/gather/AeLogistics/sellerShipmentForTop',
    method: 'get',
    params: query
  })
}

// 将订单改为自发货
export function chooseSelfShipments(query) {
  return request({
    url: '/order/order/sellerOrder/chooseSelfShipments',
    method: 'get',
    params: query
  })
}

// 上传采购信息
export function uploadPurchaseInfo(query) {
  return request({
    url: '/gather/purchase/sellerOrder/uploadPurchaseInfo',
    method: 'get',
    params: query
  })
}

// 查看订单发货信息
export function queryOrderSendGoodsInfo(query) {
  return request({
    url: '/order/order/sellerOrderExtend/queryOrderSendGoodsInfo',
    method: 'get',
    params: query
  })
}

// 保存自发货信息
export function uploadSendInfo(query) {
  return request({
    url: '/gather/purchase/sellerOrder/uploadSendInfo',
    method: 'post',
    data: query
  })
}

// 自发货声明发货
export function sellerShipmentForMyself(query) {
  return request({
    url: '/gather/purchase/sellerOrder/sellerShipmentForMyself',
    method: 'post',
    data: query
  })
}

// 获取测评订单
export function queryEvaluationOrder(query) {
  return request({
    url: '/gather/gather/sellerStoreProductEvaluation/list',
    method: 'get',
    params: query
  })
}

// 自发货订单回显已上传的采购信息
export function queryPurchaseInfo(query) {
  return request({
    url: '/gather/purchase/sellerOrder/queryPurchaseInfo',
    method: 'get',
    params: query
  })
}

// 从速卖通获取单个订单
export function queryOrderFromAeByOrderId(query) {
  return request({
    url: '/gather/AeOrder/queryOrderFromAeByOrderId',
    method: 'get',
    params: query
  })
}

// 点击修改单号后，自动确认发货
export function sendOutOrderToFPX(query) {
  return request({
    url: '/gather/purchase/sellerOrder/autoConfirmShipment',
    method: 'get',
    params: query
  })
}

// 获取自动化关联店铺订单列表
export function selectOrderAssociation(data) {
  return request({
    url: '/purchase/sellerOrder/selectOrderAssociation',
    method: 'get',
    params: data
  })
}

// 编写物流单号后更改订单状态
export function purchaseCreateLogisticsNumber(query) {
  return request({
    url: '/purchase/sellerOrder/purchaseCreateLogisticsNumber',
    method: 'get',
    params: query
  })
}
